package com.thread.local;

import java.util.ArrayList;
import java.util.List;

public class Test {

	private static ThreadLocal<String> tl = new ThreadLocal<>();

	public static void main(String[] args) {
		
		new ArrayList<>(null);//java.lang.NullPointerException
		
		TestA a = new TestA("李欢欢");
		TestA b = new TestA("李欢");
		TestA c = new TestA("欢");
		
//		new 
	}

	static class TestA implements Runnable {

		String name;

		public TestA(String name) {
			this.name = name;
		}

		@Override
		public void run() {
			tl.set(name);
		}

	}

}
